<?php

require_once ('libraryfiles/config.php');
$de = mysql_real_escape_string($_GET["decode"]);
$de = rtrim($de, '/');
$de = explode('/', $de);
$test = array(Tblcompany::shorturl=>$de[0]);
$result = select(Tblcompany::tblcompany, array(Tblcompany::shorturl), array(Tblcompany::shorturl=>$de[0]));
$row = mysql_fetch_assoc($result);

//$result = mysql_query("SELECT * FROM tblpharmacy WHERE shorturl='" . $de[0] . "'");
if (!empty($row)) {
    $home = W_ROOT;
    $CURRENT_URL = $_SERVER['REQUEST_URI'];
    //$get_user_id = parse_url($CURRENT_URL, PHP_URL_PATH);
    /* print_r(parse_url($test)); */

    //for 
    if (!empty($de[1])) {

        if (!empty($de[1])) {
            $subb = $de[1];
        } else {
            $subb = '';
        }
        $suba = $de[0];
    }
    if (!empty($de[1])) {
        $catid = $de[1];
    }
    // end for
    $last_word = $de[0]; // test
    $seller = $de[0]; // test
    $res = 'company/index.php';
    require_once ($res);
}


//print_r($de);
if (isset($de[1])) {
    $last_word = $de[0];
    $seller = $de[0];
    $file = "company/" . $de[1] . ".php";
    if (file_exists($file)) {
        require $file;
    }
}
?>

